import Vue from 'vue'
import Router from 'vue-router'

import Home from '../components/Home/Home'
import Classify from '../components/Classify/Classify'
import Shopcar from '../components/Shopcar/Shopcar'
import My from '../components/My/My'
import Login from '../components/My/Login'
import RecommendInfo from '../components/Share/RecommendInfo'
import Register from '../components/My/Register'
import Address from '../components/My/Address'
import AddressEdit from '../components/My/AddressEdit'

Vue.use(Router)

export default new Router({
    routes: [
        { path: '/', redirect: "/home", component: Home }, //用redirect将页面定向到home
        { path: '/home', component: Home },
        { path: '/classify', component: Classify },
        { path: '/shopcar', component: Shopcar },
        { path: '/my', component: My },
        { path: '/login', component: Login ,name : 'login' },
        { path: '/register', component: Register  },
        { path: '/address', component: Address  },
        { path: '/addressEdit', component: AddressEdit  },

        { path: '/recommendInfo/:id', component: RecommendInfo },
    ],
    linkActiveClass: "router-active" //声明想在路由点击触发时候的Clas
})
